<%@ page contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>物资采购与产品整合管理系统</title>
<link href="${pageContext.request.contextPath }/css/main.css" rel="stylesheet" type="text/css" media="all" />
<script src="${pageContext.request.contextPath }/js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="${pageContext.request.contextPath}/js/jquery-3.2.1.js"></script>
    <script>
        $(function () {
            $("#passbtn").click(function () {
                $.ajax({
                    url:"${pageContext.request.contextPath}/order.do?op=checkeup",
                    type:"post",
                    dataType:"text",
                    data:"orderid="+$("#orderid").val(),
                    success:function (result) {
                        alert(result);
                        location.href="${pageContext.request.contextPath}/order.do?op=checkquery";
                    }
                })
            });

            $("#nobtn").click(function () {
                $.ajax({
                    url:"${pageContext.request.contextPath}/order.do?op=checkno",
                    type:"post",
                    dataType:"text",
                    data:"orderid="+$("#orderid").val(),
                    success:function (result) {
                        alert(result);
                        location.href="${pageContext.request.contextPath}/order.do?op=checkquery";
                    }
                })
            });
        });
    </script>
</head>

<body class="content-pages-body">
<div class="content-pages-wrap">
	<div class="commonTitle">
	  <h2>&gt;&gt; 订单管理</h2>
	</div>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="commonTableSearch">
       	<form id="form-search" name="form-search" action="${pageContext.request.contextPath}/order.do?op=checkquery" method="post">
        <tr>
            <th align="right">订单编码：</th>
            <td><input name="ordercode" type="text" class="inputTextNormal" id="textfield1" value="${ordercode}"/></td>
            <th align="right">订单保存时间：</th>
            <td><input name="orderdate" type="text" class="inputTextNormal" id="textfield2" value="${orderdate}"/></td>
            <td align="right">订单状态：</td>
            <td>
            		<select name="orderflag">
						<option value="">---请选择---</option>
                        <c:forEach items="${orderFlags}" var="flag">
                            <option value="${flag.code}" <c:if test="${orderFlag==flag.code}">selected</c:if> >${flag.name}</option>
                        </c:forEach>
					</select></td>

            <th align="right">
				<input type="submit" class="btnShort" value="检索" />
			</th>
        </tr>
        <tr>

          </tr>
       	</form>
    </table>


 
	<br>

    <table width="101%" border="0" cellpadding="0" cellspacing="1" class="commonTable">
        <tr>
            <th>序号</th>
            <th>订单编码</th>
            <th>订单保存时间</th>
            <th>订单状态</th>
            <th class="editColDefault">操作</th>
        </tr>
<c:forEach items="${pageInfo.list}" var="order">
        <tr>
            <td align="center">${order.orderid}</td>
            <td align="center">${order.ordercode}</td>
            <td align="center">${order.orderdate}</td>
            <td align="center"><c:choose>
            <c:when test="${order.orderflag==2}">
                <span style="color:blue ">${order.name}</span>
            </c:when>
            <c:when test="${order.orderflag==3}">
                <span style="color:#45ff59">${order.name}</span>
            </c:when>
                <c:when test="${order.orderflag==4}">
                    <span style="color:#ff1a23">${order.name}</span>
                </c:when>
        </c:choose></td>
        </td>
            <td align="center">
                <c:if test="${order.orderflag=='2'}">
                    <input id="orderid" type="hidden" name="orderid" value="${order.orderid}">
                <a href="javascript:void(0)" style="color: #fa9a27;border-bottom: 1px solid chartreuse" id="passbtn">通过</a>
                <a href="javascript:void(0)" style="color: #3c55f4;border-bottom: 1px solid red" id="nobtn">不通过</a>
                </c:if>
            </td>
        </tr>
</c:forEach>
  </table>
    <!--//commonTable-->
    <div>
        <%@include file="/page/common/subpage.jsp" %>
    </div>
</div>
<!--//content pages wrap-->
</body>
</html>
